package com.itheima.springbootinittest10;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
@MapperScan(basePackages = "com.itheima.springbootinittest10.dao")//这一行,可以解决找不到mapper的问题
public class SpringbootInitTest10Application {
    public static void main(String[] args) {
        //返回spring的ioc容器,什么是ioc容器?
        ConfigurableApplicationContext configurableApplicationContext=SpringApplication.run(SpringbootInitTest10Application.class, args);
        //获取bean,redisTemplate
        Object redisTemplate=configurableApplicationContext.getBean("redisTemplate");
        System.out.println(redisTemplate);

        Object user= configurableApplicationContext.getBean("user");//这返回的是个配置项不是bean对象
        System.out.println(user);
    }
}
